﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="listnews.ascx.cs" Inherits="controls_admin_listnews" %>
<div id="content">
	    <div class="box corners shadow">
            <div class="box-header">
                <h2>Danh sách bài viết</h2>
                <div class="box-header-ctrls">	
            	    <a href="javascript:void(null);" title="" class="close"><!-- --></a>
                </div>
            </div>            
            <div class="box-content" id="articles-2">
               <div class="inbox-sf">                    
                    <asp:TextBox ID="txtTuKhoa" runat="server" onFocus="if(this.value=='Tìm kiếm bài viết')this.value='';" onBlur="if(this.value=='')this.value='Tìm kiếm bài viết';" value="Tìm kiếm bài viết" class="input-1"></asp:TextBox>                    
                    <asp:DropDownList ID="ddlChuyenMuc" runat="server" class="select-1" Width="250px">
                        <asp:ListItem Value="0">---Tìm theo chuyên mục---</asp:ListItem>
                    </asp:DropDownList>
                    <asp:Button ID="btnTim" runat="server" class="inbox-sf-search-btn" Text="Tìm" 
                        onclick="btnTim_Click"/>
                    <div class="form-msg-good-advanced" runat="server" id="msgSuccess" style="display:none; float:left; margin-left:20px; margin-bottom:20px; width:220px;"></div>
                    <asp:Button ID="btnThem" runat="server" Text="Thêm" 
                        class="inbox-sf-add-btn tip" title="Thêm một bài viết mới" 
                        onclick="btnThem_Click" />
                      
                </div>
                <ul class="articles-list-2">                    
                    <!--tes-->
                    <table id="tablesorter-contact" style="width:100%">
                    <asp:Repeater ID="rptDanhSachTinTuc" runat="server" 
                            onitemcommand="rptDanhSachTinTuc_ItemCommand">                         
                        <ItemTemplate>                                                                                
                                <li class="art" style="height:180px ;width : 98%">
                                    <div class="articles-left">
                    	                <h2><a href="#"><%#Eval("TieuDe")%></a></h2>
                                        <p><a href="<%#"../uploads/imagenewsupload/" + Eval("HinhAnh")%>" title="<%#Eval("TieuDe")%>" class="pirobox_media3">
                                                <img src="<%#"../uploads/imagenewsupload/" + Eval("HinhAnh")%>" /> 
                                            </a>                                             
                                            <%#Eval("TomTat")%>
                                        </p>
                                    </div>
                                    <ul class="articles-right">
                                        <li><b>Chuyên mục: </b> <%#Eval("Ten")%></li>
                    	                <li><b>Ngày viết:</b> <%#Eval("NgayDang")%></li>
                                        <li><b>Người viết:</b> <a href="#"><%#Eval("TenDangNhap")%></a></li>
                                        <li><b>Trạng thái:</b> <%#(Boolean.Parse(Eval("TrangThai").ToString()) == true)?"Đã đăng":"Chờ duyệt"%></li>                                        
                                        <li class="articles-right-ctrls">
                                           <asp:HyperLink ID="hplSua" runat="server" class="edit-contact gradient-btn" title="Sửa bài viết" NavigateUrl='<%# "~/admin/addnews.aspx?action=edit&info=" + Eval("Id") %>'>Sửa</asp:HyperLink>
                                            <asp:LinkButton ID="hbTrangThai" runat="server" class="edit-contact gradient-btn" title="Thay đổi trạng thái " CommandArgument='<%# Eval("Id")%>' CommandName="statusupdate">Trạng thái</asp:LinkButton>                                        
                                            <asp:LinkButton ID="lbXoa" runat="server" title="Xóa bài viết này" onclientclick="return confirm('Chắc chắn rằng bạn muốn xóa bài viết này?');" class="delete-contact gradient-btn" CommandArgument='<%# Eval("Id")%>' CommandName="xoa">Xóa</asp:LinkButton>
                                            <asp:HyperLink ID="hpXemBinhLuan" runat="server" class="edit-contact gradient-btn" title="Xem danh sách bình luận" NavigateUrl='<%# "~/admin/listcomments.aspx?info=" + Eval("Id") %>'>Xem bình luận</asp:HyperLink>
                                            <input type="checkbox" name="" class="check"/>
                                        </li>
                                    </ul>
                                </li> 
                        </ItemTemplate>
                        <FooterTemplate></tbody></FooterTemplate>
                    </asp:Repeater>                                            
                </table>
                <div class="form-msg-warning-advanced" runat="server" id="msgSearch" style="display:none; float:left; margin-left:0px; margin-bottom:20px; width:220px;">Không có kết quả như yêu cầu tìm kiếm!</div>
                <div class="form-msg-warning-advanced" runat="server" id="msgNoRows" style="display:none; float:left; margin-left:0px; margin-bottom:20px; width:200px;">Dữ liệu đang cập nhật...</div>                                         
                </ul>                  
                <div class="box-bt-bar">            
                    <ul class="box-nav" style="display:inline-table;" runat="server" id="PhanTrang">
                        <li>
                            <asp:LinkButton ID="lbtnFirst" runat="server" CausesValidation="false" 
                                        OnClick="lbtnFirst_Click" CssClass="prev">Đầu</asp:LinkButton>
                        </li>
                        <li>
                            <asp:LinkButton ID="lbtnPrevious" runat="server" CausesValidation="false" 
                                        OnClick="lbtnPrevious_Click" CssClass="prev">Trước</asp:LinkButton>
                        </li>
                        <li>
                            <asp:DataList ID="dlPaging" runat="server" OnItemCommand="dlPaging_ItemCommand" 
                                OnItemDataBound="dlPaging_ItemDataBound" RepeatDirection="Horizontal">
                                <ItemTemplate>                                
                                    <asp:LinkButton ID="lnkbtnPaging" runat="server" CssClass="num" 
                                        CommandArgument='<%# Eval("PageIndex") %>' CommandName="Paging" 
                                        Text='<%# Eval("PageText") %>'></asp:LinkButton>                                
                                </ItemTemplate>
                            </asp:DataList>
                        </li>                        
                        <li>
                            <asp:LinkButton ID="lbtnNext" runat="server" CausesValidation="false" 
                                        OnClick="lbtnNext_Click" CssClass="next">Tiếp</asp:LinkButton>
                        </li>
                        <li>
                            <asp:LinkButton ID="lbtnLast" runat="server" CssClass="next" CausesValidation="false" 
                                        OnClick="lbtnLast_Click">Cuối</asp:LinkButton>
                        </li>                        
                        <asp:Label ID="lblPageInfo" runat="server" Visible="false"></asp:Label>
                    </ul>
                    <div class="bulk-actions">
                       <asp:Button ID="btnLamMoi" runat="server" Text="Làm mới" 
                            class="inbox-sf-add-btn tip" title="Làm mới danh sách" 
                            onclick="btnLamMoi_Click" />
                        </div> 
                </div>                                       
            </div>
        </div>                                                         
</div>